#!/bin/bash
# Check if user is root

if [[ $(id -u) != "0" ]]; then
    printf "Error: You must be root to run this script!
"
    exit 1
fi

if [ ! -z "`netstat -apnl|grep 9092 |awk '{printf $7}'|cut -d/ -f1`" ]; then
    kill -9 `netstat -apnl|grep 9092 |awk '{printf $7}'|cut -d/ -f1`
fi

/home/anaconda/bin/uwsgi -x /root/el_guowang/uwsgi.xml --buffer-size  32768
service nginxd restart
